There were two main projects I worked on: Creating a solenoid class and ensuring PDO communication.
With the solenoid class, I created functionality to be able to move the forks, in the Swing Reach Forklift, up/down, left/right, and rotate.
Creating a single solenoid wasn't a problem, the trickiness came when creating a group of solenoids that are needed to perform.
an action. Two different solenoids couldn't go off at the same time if they were the solenoids are reused for other functions.
The route I took was to classify each solenoid and determine whether it was a part of one or more functionalities. If it was apart
of multiple functionalities, the process would wait until it finished turning off so that the selected process was in a ready state
until it proceeded.
A part of this project, an edge case was brought to my attention that I hadn't thought of. The edge case was that
if the solenoid was in the middle of transitioning to process and the user wanted to stop the process or change the process. Now stopping the process
is the same as changing the process, going into its state where no fork movements are happening. So, I mention this word in the previous paragraph, but this
is where ready state came. If the solenoid was in the middle of transitioning, it would finish transition, and if the user wanted to change the process during
its transition, it immediately goes transition to its desired position. To put this into example, if the forklift's forks are moving up and the user has a quick decision
to move left, right, then back up again, the solenoid would transition to the left, and depending on if right was only called during the transition, it wouldn't activate
because it couldn't, then start transitioning back to moving up. This is meant so that the actions are very deliberate and not accidental.